package com.design.springboot.booksharing.service.impl;

import com.design.springboot.booksharing.bean.BookInfo;
import com.design.springboot.booksharing.bean.QueryWarp;
import com.design.springboot.booksharing.dao.BookInfoDao;
import com.design.springboot.booksharing.service.BookInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 书籍信息表(BookInfo)表服务实现类
 *
 * @author admin
 */
@Service("bookInfoService")
public class BookInfoServiceImpl implements BookInfoService {
    @Resource
    private BookInfoDao bookInfoDao;

    @Override
    public Boolean saveBookInfo(BookInfo bookInfo) {
        return bookInfoDao.saveBookInfo(bookInfo) > 0;
    }

    @Override
    public Boolean deleteBookInfo(Integer id) {
        return bookInfoDao.deleteBookInfo(id) > 0;
    }

    @Override
    public Boolean updateBookInfo(BookInfo bookInfo) {
        return bookInfoDao.updateBookInfo(bookInfo) > 0;
    }

    @Override
    public BookInfo getBookInfoById(Integer id) {
        return bookInfoDao.getBookInfoById(id);
    }

    @Override
    public List<BookInfo> listBookInfo(QueryWarp<BookInfo> queryWarp) {
        return bookInfoDao.listBookInfo(queryWarp);
    }
}
